<?php
namespace Admin\Controller;
use Admin\Controller\AiController;
class AdminLogController extends AiController {
    function index($admin_name = '',$controller='',$action='',$time_start='', $time_end='') {
        $where = ' 1=1 ';
        $time_start_spm = $time_start!='' ? strtotime($time_start) : '0';
        $time_end_spm 	= $time_end!='' ? strtotime($time_end.' 23:59:59') : '0';
        if ($admin_name)	    $where .= " AND admin_name LIKE '%{$admin_name}%'";
        if ($controller)	    $where .= " AND controller LIKE '%{$controller}%'";
        if ($action)	        $where .= " AND action LIKE '%{$action}%'";
        if ($time_start_spm>0) 	$where .= " AND add_time>=".$time_start_spm;
        if ($time_end_spm>0) 	$where .= " AND add_time<=".$time_end_spm;

        $this->assign('admin_name',$admin_name);
        $this->assign('controller',$controller);
        $this->assign('action',$action);
        $this->assign('time_start',$time_start);
        $this->assign('time_end',$time_end);
        $this->_list($where);
    }
}
